for rel in cl.associacoes:
  extra = ""
  if len(rel.extras):
    for ex in rel.extras:
      extra+=", %s='%s'" %(ex['nome'],ex['valor'])
    if rel.cardinalidade[0] == '*' and rel.cardinalidade[1] == '*':
      yield '    %s = models.ManyToManyField(%s%s)' % \ 
      	(str.lower(str(rel.classe)), rel.classe, extra)
    for rel in cl.associacoes:
    extra = ""
    if len(rel.extras):
      for ex in rel.extras:
        extra+=", %s='%s'" %(ex['nome'],ex['valor'])
      if rel.cardinalidade[0] == '*' and rel.cardinalidade[1] == '*':
        yield '    %s = models.ManyToManyField(%s%s)' % \
        		(str.lower(str(rel.classe)), rel.classe, extra)
      else:
        yield '    %s = models.ForeignKey(%s%s)' % \
        		(str.lower(str(rel.classe)), rel.classe, extra)
